home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PCBDXEXC.ZIP / BATCH.DOC next >
Text File  |  1993-08-22  |  19KB  |  422 lines

  1. 13
  2. ============================================================================
  3.                                                                  Batch Files
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. Door Batch Files
  14.  
  15. Event Batch Files
  16.  
  17. External File Transfer Protocols
  18.  
  19. NODE.BAT
  20.  
  21. PCBCMPRS.BAT
  22.  
  23. PCBQWK.BAT
  24.  
  25. PCBTEST.BAT
  26.  
  27. PCBVIEW.BAT
  28.  
  29. REMOTE.SYS
  30.  
  31. $$LOGON.BAT
  32.  
  33. $$LOGOFF.BAT
  34.  
  35.  
  36. This chapter discusses the various batch files used by PCBoard including any 
  37. special information you should know about these files.  PCBoard uses numerous 
  38. batch files to increase its flexibility.  Because batch files are used 
  39. throughout PCBoard you can control the programs that are actually run. If you 
  40. are unfamiliar with batch files, please refer to your DOS manual for further 
  41. instructions on creating batch files.
  42.  
  43. Door Batch Files
  44.  
  45. One of the most flexible aspects of PCBoard is its ability to run 
  46. applications as door programs.  As mentioned previously, a door simply 
  47. executes a batch file.  Since it is a batch file, you can run anything for a 
  48. door.  However, if you want the door to interact with the user, you must 
  49. insure that the program supports the serial ports you have installed on your 
  50. machine. If you are using the multiport version of PCBoard and COMM-TSR, the 
  51. program that you want to interact with the user must support the FOSSIL 
  52. interface.
  53.  
  54. In the DOORS.LST file for each conference, you specify the batch file that 
  55. will be run when the user opens the door.  To find out the filename and the 
  56. location of the batch file, combine the Filename and Path to DOOR files 
  57. fields.  The following entry requires that you edit C:\PCB\QUERY to modify 
  58. the batch file:
  59.  
  60.                                    USER DOOR
  61.   Filename    Password   Sec Login SYS  SYS  Shell    Path to DOOR Files
  62.  ---------- ------------ --- ----- ---- ---- ----- ---------------------
  63. 1) QUERY                   0   N    Y    N     N   C:\PCB\
  64.  
  65. Notice that there is no BAT extension that is usually associated with a batch 
  66. file.  Rather than editing the batch file from the DOS prompt, you can 
  67. highlight the Filename field and press F2 to use the text editor defined in 
  68. System Manager.
  69.  
  70. Event Batch Files
  71.  
  72. Each event can have a batch file for each node.  If a node-specific batch 
  73. file is not defined, it will run the batch file without an extension.  For 
  74. example, if you have the following event defined
  75.  
  76.                Batch     Begin  End
  77.      Act  Mod  File      Time   Time
  78.      ---  ---  --------  -----  -----
  79. 1)    Y    E   DAILY     06:45  07:00
  80.  
  81. and the location of your event batch files are:
  82.  
  83. Location of EVENT Files               : C:\PCB\EVENTS\
  84.  
  85. you would need to edit the C:\PCB\EVENTS\DAILY to modify the programs that 
  86. will run during your event.  As with door batch files, you will notice that 
  87. this batch file does not have a BAT extension.  This gives you the ability to 
  88. create node-specific batch files, if you have different nodes performing 
  89. different tasks.
  90.  
  91. Hypothetically, you could have one node packing the message and user files 
  92. while other nodes run maintenance programs for door or other utility programs 
  93. you have installed.  To perform this in a two node system, you would create 
  94. the following batch files:
  95.  
  96. DAILY.001
  97. DAILY.002
  98.  
  99. The extension specified represents the node number that the batch file will 
  100. run on.  Under no circumstances will DAILY.001 run on node 2 or likewise 
  101. DAILY.002 on node 1.  If a node cannot find a node-specific event batch file 
  102. it will check to see if a batch file exists without the node number 
  103. extension.  If it exists, that batch file will run.  If it does not, the node 
  104. will not run the event.
  105.  
  106. External File Transfer 
  107. Protocols
  108.  
  109. Even though 8 file transfer protocols are provided with PCBoard (7 internal 
  110. and 1 external), you may need to add additional protocols to satisfy the 
  111. needs of your users.  Any protocols that you add to the system are called 
  112. external protocols. External protocols require two batch files to be created 
  113. before the protocol will be available to your callers -- one for receiving 
  114. and one for sending.  In the batch files, you will need to run the external 
  115. protocol program.  Most external protocols ship with one executable and you 
  116. use command line parameters to determine if the protocol is sending or 
  117. receiving.
  118.  
  119. Protocols are defined by a letter or digit in PCBPROT.DAT (PCBSetup | File 
  120. Locations | Configuration Files).  The receive batch file will be named using 
  121. the following convention:
  122.  
  123. PCBR[protocol letter].BAT
  124.  
  125. Likewise, the send batch file will be named:
  126.  
  127. PCBS[protocol letter].BAT
  128.  
  129. In these examples, replace [protocol letter] with the character you entered 
  130. in the Use column of PCBPROT.DAT to define the protocol.
  131.  
  132. Because there are so many external protocols, no specific instructions can be 
  133. given for installing the protocols.  To help interface with the external 
  134. protocol, PCBoard passes parameters to the batch file.
  135.  
  136. Parameters Passed
  137.  
  138. To use a parameter in your batch file, enter the parameter when you want to 
  139. use what it represents.  For example, %1 for external protocols will return 
  140. the COM port number defined in PCBSetup | Modem Information | Modem Setup. If 
  141. your protocol needs this information, place %1 in the appropriate place in 
  142. your batch file.  The parameters passed to external protocols are:
  143.  
  144.         %1      Returns the COM port number defined in PCBSetup | Modem 
  145.                 Information | Modem Setup.  If you are using standard serial 
  146.                 ports with non-standard definitions for the base address or 
  147.                 IRQ, you will need to provide that information to the 
  148.                 protocol yourself because PCBoard does not provide this 
  149.                 information.
  150.  
  151.         %2      Returns the speed between the modem and the computer.  This 
  152.                 is commonly referred to as the DTE speed.  For modems which 
  153.                 support locked port rates, the value of %2 will be the 
  154.                 opening port rate speed defined in PCBSetup | Modem 
  155.                 Information | Modem Setup.
  156.  
  157.         %3      Specifies the file(s) to transfer.  The actual text that is 
  158.                 passed as the parameter varies depending on the type of 
  159.                 protocol and whether files are being sent or received.
  160.  
  161.                 Batch file transfers (Protocol types D and B):  When sending 
  162.                 a single file, the location of the file will be passed.  When 
  163.                 sending more than one file, the filenames that are to be 
  164.                 transferred will be provided in a carriage return / line feed 
  165.                 delimited list.  An @ sign is specified before the filename 
  166.                 to the list as it is the most common way to refer to such a 
  167.                 list. Check to make sure that your external protocol supports 
  168.                 this method.  When receiving files, the private upload 
  169.                 directory for the current conference will be passed.
  170.  
  171.                 Non-batch file transfers (Protocol type S):  The filename to 
  172.                 be sent or received is always specified.
  173.  
  174.         %4      Returns the connect speed as reported by PCBoard. 
  175.                 Error-correcting modems will report the locked port rate 
  176.                 speed. Other connections will report the carrier speed.
  177.                 
  178.         %5      Returns the connect speed as reported by the modem.  This is 
  179.                 referred to as the carrier or DCE speed.
  180.  
  181.         %6      Returns the private upload directory for the current 
  182.                 conference.  This parameter is most commonly used in 
  183.                 conjunction with bi-directional protocol because they need to 
  184.                 know where the upload directory is even while 
  185.                 downloading.
  186.                 
  187. NODE.BAT
  188.  
  189. In addition to displaying who is online to the system, PCBMoni has the 
  190. capability to run a batch file for a particular node. Why would you want to 
  191. do this?  Most networks have what is called a spy utility.  This utility 
  192. enables you to spy on another machine in the network. Typically, you can view 
  193. the screen of this machine and take control of the keyboard. Obviously, this 
  194. would be handy to be able to access.
  195.  
  196. When scrolling through the list of nodes in PCBMoni, you can press ENTER on 
  197. any node and PCBoard will run NODE.BAT.  So that you know the node number 
  198. that was specified, PCBoard will pass two parameters to NODE.BAT. You should 
  199. use these parameters when calling your spy utility.
  200.  
  201. Parameters Passed
  202.  
  203. %1              The node number is specified as Node[number] where [number] 
  204.                 is replaced by the node number you pressed ENTER on.  The 
  205.                 following are examples of what will be passed:
  206.  
  207.                         Node 3
  208.                         Node 4
  209.                         Node 5
  210.  
  211.  
  212. %2              The node number with no preceding text is passed to the batch 
  213.                 file.  The following are examples of what will be passed:
  214.  
  215.  
  216.                         3
  217.                         4
  218.                         5
  219.         
  220. PCBCMPRS.BAT
  221.  
  222. If you will recall, the R user command has a Z subcommand that can be used to 
  223. capture messages in a compressed format.  To compress the captured messages, 
  224. PCBoard will execute PCBCMPRS.BAT with two parameters.
  225.  
  226. Parameters Passed
  227.  
  228.         %1      Returns the target filename.  PCBoard uses the capture 
  229.                 filename that you enter in PCBSetup | Configuration Options | 
  230.                 Messages and the extension specified in PCBSetup | File 
  231.                 Locations | Configuration Files.
  232.  
  233.         %2      Returns the source filename.  This will be the filename that 
  234.                 PCBoard temporarily captured the messages to.
  235.  
  236. If your file compression program uses the following syntax
  237.  
  238.  
  239. COMPRESS -a [target filename] [source filename]
  240.  
  241.  
  242. you would create a PCBCMPRS.BAT which looks like this:
  243.  
  244.  
  245. COMPRESS -a %1 %2
  246.  
  247.  
  248. If the target filename does not exist when PCBCMPRS.BAT is done executing, 
  249. PCBoard will report that there was an error compressing the file.  If you see 
  250. this error message, check the syntax of your batch file and make sure that 
  251. you have used the parameters properly.
  252.  
  253. NOTE:  PCBoard ships with a PCBCMPRS.BAT that is already setup for use with 
  254. PKWare's PKZIP (R) compression program.
  255.  
  256. PCBQWK.BAT
  257.  
  258. To create QWK packets and to uncompress REP packets, PCBoard will execute 
  259. PCBQWK.BAT.  There are four parameters that will be passed to the PCBQWK 
  260. batch file.
  261.  
  262. Parameters Passed
  263.  
  264.         %1      Either COMPRESS or EXTRACT is returned in all upper case. 
  265.                 When COMPRESS is returned, a QWK packet is being created.  
  266.                 When EXTRACT is returned, the user uploaded a REP packet and 
  267.                 it needs to be uncompressed so that PCBoard can insert the 
  268.                 messages.
  269.  
  270.         %2      Returns the target filename to be compressed or extracted. 
  271.                 The actual filename will be taken from PCBSetup | 
  272.                 Configuration Options | Messages.  If a QWK packet is being 
  273.                 created, QWK will be added to the filename.  Likewise, if a 
  274.                 REP packet is being uncompressed, REP will be added to the 
  275.                 filename.
  276.  
  277.         %3      Returns the work directory specified in PCBSetup | File 
  278.                 Locations | System Files.
  279.  
  280.         %4      Returns a filename that lists the files that need to be 
  281.                 included in the QWK packet.  Most compression programs 
  282.                 usually have some method for accepting file lists.  Check 
  283.                 your manual for further details.
  284.  
  285.  
  286. A sample PCBQWK.BAT might resemble the following:
  287.  
  288.  
  289. if %1==COMPRESS compress %2 @%4
  290. if %1==EXTRACT uncompres %2 %3
  291.  
  292.  
  293. NOTE:  PCBoard ships with a PCBCMPRS.BAT that is already setup for use 
  294. with PKWare's PKZIP« compression program.
  295.  
  296. PCBTEST.BAT
  297.  
  298. One major concern of most system operators is the spread of harmful computer 
  299. viruses and trojans through electronic means such as bulletin board systems. 
  300. Another concern is to make sure that all files uploaded pass integrity tests 
  301. especially if the file is compressed.  If you want, you can configure PCBoard 
  302. to test each file that is uploaded to the system.  If you want PCBoard to do 
  303. this, you must enable the Verify Uploads switch in PCBSetup | Configuration 
  304. Options | File Transfers. When upload verification is enabled, PCBoard will 
  305. execute PCBTEST.BAT with three parameters.
  306.  
  307. Parameters Passed
  308.  
  309.         %1      Returns the complete drive, path, and filename of the file 
  310.                 that should be tested.
  311.  
  312.         %2      Returns one of three responses.  If UPLOAD is returned, the 
  313.                 file being tested has just been uploaded and consequently is 
  314.                 a new file to the system.  If TEST is returned, a user is 
  315.                 using the TEST user command to verify the integrity of the 
  316.                 file presumably before downloading it.  If ATTACH is 
  317.                 returned, the file was uploaded to the system as a file 
  318.                 attachment.  You can use the response to determine what type 
  319.                 of tests (if any) should be used on the file.
  320.  
  321.         %3      When %2 returns UPLOAD, this parameter will return the 
  322.                 location of the filename that contains the description 
  323.                 entered by the user.  Programs can modify this description 
  324.                 file and PCBoard will import the changes back into the file 
  325.                 directory when posting the file.
  326.  
  327. Returning Status of File Tested
  328.  
  329. Once PCBTEST.BAT has been executed, PCBoard checks to see if either 
  330. PCBPASS.TXT or PCBFAIL.TXT exists in the current directory.  The existence of 
  331. one of these files determines whether or not the file passed the tests.
  332.  
  333. If PCBFAIL.TXT exists, PCBoard will display the contents of the file and then 
  334. fail the upload.  The file that was uploaded will remain in the private 
  335. upload directory for the conference and a FILE FAILED VERIFICATION CHECK line 
  336. will be added to the description of the file.  In addition, if a file 
  337. description is modified (%3) and the file fails verification, PCBoard will 
  338. not add the FILE FAILED VERICATION CHECK line to the description.
  339.  
  340. If PCBPASS.TXT exists, PCBoard will display the contents of the file.  If you 
  341. have defined any upload or byte credits for uploads in PCBSetup | 
  342. Configuration Options | File Transfers, those credits will be issued.
  343.  
  344. In the event that both PCBPASS.TXT and PCBFAIL.TXT exist, PCBFAIL.TXT will 
  345. take precedence.  In fact, any time that a PCBFAIL.TXT exists, the file will 
  346. be failed.
  347.  
  348. NOTE:  The PCBTEST.BAT that comes with your copy of PCBoard will test the 
  349. integrity of ARC, ARJ, and ZIP compressed files.  If you want to do virus 
  350. scanning and other tasks, you will need to use a third-party program that 
  351. will help you do this or modify the batch file yourself.
  352.  
  353. PCBVIEW.BAT
  354.  
  355. In addition to testing a file before downloading it, a user may want to view 
  356. the contents of the file.  The user can view a file while listing file 
  357. descriptions or by entering F;V at the conference command prompt.
  358.  
  359. When the user views a file, PCBoard executes the batch file that is specified 
  360. in the Batch file for viewing compressed files field of  PCBSetup | File 
  361. Locations | Configuration Files.  By default, this filename is called 
  362. PCBVIEW.BAT.  When executing this batch file, only one parameter is passed to 
  363. the batch file.
  364.  
  365. Parameter Passed
  366.  
  367.         %1      Returns the full drive, path, and filename of the filename 
  368.                 that has been requested for viewing.
  369.  
  370. After Execution of The Batch File
  371.  
  372. After the batch file has been executed, PCBoard checks for the existence of 
  373. PCBVIEW.TXT in the current directory.  The contents of this file will be 
  374. displayed to the caller.  If it does not exist, it is assumed that an error 
  375. occurred when viewing the file.
  376.  
  377. NOTE:  The PCBVIEW.BAT that has been supplied with your copy of PCBoard, will 
  378. list the files that are stored in ZIP, ARJ, ARC, and PAK compressed files. In 
  379. addition, it will view any filename that has a TXT extension to the screen.  
  380. If you examine the default PCBVIEW.BAT, you will notice that it uses 
  381. TESTFILE.EXE (also included with your copy of PCBoard) to determine the 
  382. extension of the filename and branch to an appropriate part in the batch 
  383. file.
  384.  
  385. REMOTE.SYS
  386.  
  387. When you request a remote drop to DOS using the 9 SysOp command, PCBoard will 
  388. use REMOTE.SYS as a batch file.  Therefore, you can have REMOTE.SYS load just 
  389. about anything you desire to drop to DOS.
  390.  
  391. You will need to run some sort of program that will redirect a local DOS 
  392. session to a serial port because DOS does not provide this capability. 
  393. Included with your PCBoard package is a shareware copy of DOORWAY by TriMark 
  394. Engineering and a REMOTE.SYS that is pre-configured to use DOORWAY on COM1. 
  395. This program has the capability of redirecting text screens to a standard 
  396. serial or FOSSIL port.  The ASCII version of the DOORWAY documentation is 
  397. included in a file called DOORWAY.ZIP in your \PCB directory in case you want 
  398. to make any changes to the default REMOTE.SYS.
  399.  
  400. In order to return back to PCBoard, your REMOTE.SYS should reload the proper 
  401. BOARD.BAT file.  If you do not load BOARD.BAT or if you load the wrong 
  402. BOARD.BAT, you could cause your entire system or a node on your system to 
  403. remain off-line until you get a chance to correct the mistake.
  404.  
  405. $$LOGON.BAT
  406.  
  407. Similar to $$LOGOFF.BAT, you can use $$LOGON.BAT to do special processing 
  408. after a user has logged into the system.   Once the user has properly entered 
  409. their name, and password, PCBoard will execute $$LOGON.BAT if it can be 
  410. found.  There really is no restriction on what you can run in this batch 
  411. file, but as a general rule, keep it short so that the callers do not have 
  412. excessive delays when logging in.
  413.  
  414. $$LOGOFF.BAT
  415.  
  416. If you need to do special processing after each caller has disconnected from 
  417. the system, you can use a program called $$LOGOFF.BAT.  PCBoard checks for 
  418. the existence of this file in the current directory and in each directory in 
  419. your PATH= statement.  If it is found, it will be run after the caller has 
  420. been disconnected and all files except PCBOARD.SYS have been closed.
  421.  
  422.